package com.fs.system.controller;

import com.fs.common.core.controller.BaseController;
import com.fs.common.core.pojo.SysDept;
import com.fs.common.core.tree.TreeSelect;
import com.fs.common.core.vo.AjaxResult;
import com.fs.system.service.ISysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/system/dept")
public class SysDeptController  extends BaseController {
    @Autowired
    private ISysDeptService sysDeptService;

    @GetMapping("treeselect")
    public AjaxResult treeselect(SysDept sysDept){
        List<TreeSelect> treeSelects = sysDeptService.selectDeptTreeList(sysDept);
        AjaxResult ajaxResult =  AjaxResult.success(treeSelects);
        return ajaxResult;
    }
}